package dk.iha;

import java.lang.Thread.UncaughtExceptionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CustomExceptionHandler implements UncaughtExceptionHandler {

    private UncaughtExceptionHandler defaultUEH;
	private final Logger log = LoggerFactory.getLogger(SensorLoggerActivity.class);

    public CustomExceptionHandler() {
        this.defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
    }

    public void uncaughtException(Thread t, Throwable e) {
    	log.error("Uncaught exception", e);
        defaultUEH.uncaughtException(t, e);
    }
}
